import { useContext, createContext } from 'react'

interface HomeContextType {
  swiperList: any[]
  currentItem: Record<string, any>
  showComment: (curItem: Record<string, any>) => void
}

export const HomePageContext = createContext<HomeContextType | null>(null)

export const useHomePage = () => {
  const context = useContext(HomePageContext)
  if (!context) {
    throw new Error('useHome must be used within a HomeProvider')
  }
  return context
}
